package com.myhome.controller;

import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;

/**
 * @Author QYiXin
 * @Date 2021 10 04 16 17
 **/
@RestController
public class UserController {
    @GetMapping("/user/info")
    public Object getUserInfo(Authentication authentication){
        System.out.println("1");

        return authentication.getPrincipal();
    }
}
